package mk.jug.academy.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;

/**
 * Entity class modeling a sponsor (highest form of support) for the JUGMK Academy.
 *
 * @author Ice.Penov
 */
@Entity @SuppressWarnings("serial")
public class Sponsor extends User {
	
	public static final String CODE_PREFIX = "SPN-";
		
	public Sponsor() {
		setRole(UserType.SPONSOR.toString());
	}
	
	@Column(nullable = false)
	private String name;
	
	@Column(nullable = false)
	private String description;
	
	@Column
	private String url;
	
	@Column @Enumerated
	private SponsorStatus status;
	
	@Override
	public String getDisplayName() {
		return name;
	}
	
	/**
	 * The code identifier of the entity. 
	 */
	public String getCode() {
		return CODE_PREFIX + getId();
	}
		
	/**
	 * Returns the codePrefix.
	 */
	public static String getCodePrefix() {
		return CODE_PREFIX;
	}

	/**
	 * Returns the name.
	 */
	public String getName() {
		return name;
	}

	/**
	 * Setter for the name.
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Returns the description.
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Setter for the description.
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * Returns the url.
	 */
	public String getUrl() {
		return url;
	}

	/**
	 * Setter for the url.
	 */
	public void setUrl(String url) {
		this.url = url;
	}

	/**
	 * Returns the status.
	 */
	public SponsorStatus getStatus() {
		return status;
	}

	/**
	 * Setter for the status.
	 */
	public void setStatus(SponsorStatus status) {
		this.status = status;
	}

}